﻿using System;
using System.Text.RegularExpressions;

class ParseUrl
{
    static void ParseUrlMethod(string url)
    {
        Regex r = new Regex(@"(?<protocol>\w+)://(?<server>[\w|\.|-]+)/(?<resource>(.|\s)+)");
        Match m = r.Match(url);
        while (m.Success)
        {
            GroupCollection groups = m.Groups;
            Console.WriteLine("protocol = \"{0}\", server = \"{1}\", resource = \"{2}\"", groups["protocol"], groups["server"], groups["resource"]);
            m = m.NextMatch();
        }
    }

    static void Main()
    {
        ParseUrlMethod(@"http://www.devbg.org/forum/index.php");
    }
}

